<template>
  <cfg-form
    :ref="ref"
    v-bind="attrs"
    :data="data"
  ></cfg-form>
</template>

<script>
const ref = "approvalView";
export default {
  name: ref,
  components: {},
  inject: ["anc"],
  data() {
    return {
      ref: ref,
      onlyRead: false,
    };
  },
  props: {
    data: {
      default: () => {
        return {};
      },
    },
    
  },
  watch: {},
  computed: {
     attrs() {
      return {
        labelWidth: 100,
        labelPosition: "right",
        cols: 3,
        columns: [
          {
            key: "operatorName",
            title: "审批人",
            minWidth: 100,
            align: "center",
            show: true,
            config: {
              type: "text",
              readonly: true,
            },
          },
          {
            key: "operateTime",
            title: "审批时间",
            minWidth: 100,
            align: "center",
            show: true,
            config: {
              type: "datetime",
              readonly: true,
            },
          },
          {
            key: "status",
            title: "审批状态",
            minWidth: 100,
            align: "center",
            show: true,
            config: {
              type: "text",
              readonly: true,
            },
          },
          {
            key: "action",
            title: "审批动作",
            minWidth: 100,
            align: "center",
            show: true,
            config: {
              type: "text",
              readonly: true,
            },
          },
          {
            key: "opinions",
            title: "审批建议",
            minWidth: 100,
            align: "center",
            show: true,
            config: {
              type: "textarea",
            },
          },
        ],
      };
    },
  },
  created() {},
  mounted() {
    this.$nextTick(() => {
      this.$set(this.anc.vms, this.ref, this);
    });
  },
  methods: {
    validate(fn) {
      return this.$refs[this.ref].$refs["form"].validate((valid) => {
        fn(valid);
      });
    },
  },
};
</script>
<style scoped></style>
